package com.tw.todolistservice.model;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class ToDo{
    private String category;
    private String Content;
    private Date createdAt;
    public ToDo(String category, String content, String createdAt) throws ParseException {
        this.category = category;
        Content = content;
        this.createdAt  = new SimpleDateFormat("yyyy-MM-dd").parse(createdAt);;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getContent() {
        return Content;
    }

    public void setContent(String content) {
        Content = content;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    @Override
    public String toString() {
        return "ToDo{" +
                "category='" + category + '\'' +
                ", Content='" + Content + '\'' +
                ", createdAt=" + createdAt +
                '}';
    }
}
